package pers.mobian.springninth.spring;

import pers.mobian.springninth.annotation.MobianScan;
import pers.mobian.springninth.config.MobianConfig;

import java.lang.annotation.Annotation;

/**
 * @Date 2021/9/4 9:41
 * @Created mobian
 * @Description
 */
public class MobianContext {

	private Class configClass;

	public MobianContext(Class configClass) {
		this.configClass = configClass;

		if (configClass.isAnnotationPresent(MobianScan.class)) {
			MobianScan annotation = (MobianScan) configClass.getAnnotation(MobianScan.class);
			String scanPath = annotation.value();

			String urlPath = scanPath.replace(".","/");
			System.out.println(urlPath);
			ClassLoader classLoader = MobianContext.class.getClassLoader();
			System.out.println(classLoader.getResource(urlPath));

		}

	}
}
